﻿<!--#include file="const.asp"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>


<%
if sid="Null" then
	Response.Redirect "login.asp"
	Response.end
end if

%>
<%If Request("SubmitFlag") <> "" Then%>
<card id="main" title="查看源码">
<p>
<% 
On Error Resume Next
Server.ScriptTimeOut=9999999
url=qingtian.utf8(request("url"))
%>
地址:<%=url%><br/>
<% 
dim Page
Page=request.QueryString("Page")
if Page="" then Page="1"
Dim Url,Html,start,over,body,wap,wstr,str
Url=""&url&""
wstr=getHTTPPage(url)
start=Instr(wstr,"<p")
over=Instr(wstr,"</p>")+4
body=mid(wstr,start,over-start)
'------------------------------------------------
body = replace(body,"<p>","")
body = replace(body,"</p>","")
body = replace(body,"<p align=""left"">","")
body = replace(body,"<p align=""center"">","")
body = replace(body,"<p align='left'>","")
body = replace(body,"<p align='center'>","")
body = replace(body,"&","&amp;")
body = replace(body,"<","&lt;")
body = replace(body,">","&gt;")
body = replace(body,"$","$$")
body = replace(body,"&amp;#x","&#x")
body = replace(body,"'","&apos;")
body = replace(body,"""","&quot;")
'--------------------------------------------------
%>
<%if len(body)>30 then%>
<%=body%><br/>
<input name="url<%=minute(now)%><%=second(now)%>" value="<%=body%>"/>
<%else%>
该地址无法查看
<%end if%><br/>
<a href="qingu.asp?sid=<%=sid%>">[继续查看]</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%else%>
<card id="main" title="源码查看器" >
<p>
地址:<input name='url' value='http://'/><br/>
<anchor>查看源码<go href='qingu.asp?SubmitFlag=true&amp;sid=<%=sid%>' method='post' accept-charset='utf-8'>
<postfield name='url' value='$(url)'/>
</go></anchor>
<br/>	
<%end if%>	
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%

end Function 
Function getHTTPPage(Path)
 t = GetBody(Path)      
End function
function getHTTPPage(url) 
dim Http 
set Http=server.createobject("Microsoft.XMLHTTP") 
Http.open "GET",url,false 
Http.send() 
if Http.readystate<>4 then 
exit function 
end if 
getHTTPPage=bytesToBSTR(Http.responseBody,"utf-8")
set http=nothing 
if err.number<>0 then err.Clear 
end function 

Function BytesToBstr(body,Cset) 
dim objstream 
set objstream = Server.CreateObject("adodb.stream") 
objstream.Type = 1 
objstream.Mode =3 
objstream.Open 
objstream.Write body 
objstream.Position = 0 
objstream.Type = 2 
objstream.Charset = Cset 
BytesToBstr = objstream.ReadText 
objstream.Close 
set objstream = nothing 
End Function 
%>